<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Bootstrap 实例 - 响应式表格</title>
	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
   <div class="row">
      <div class="col-xs-3"></div>
      <div class="col-xs-4"><h1>用户信息列表</h1></div>
       <div class="col-xs-4"></div>
      <div class="col-xs-1"><a href="login.html" class="btn btn-default" role="button">登录</a></div>
   </div>
</div>

<div class="table-responsive">
	<table class="table table-bordered table-striped">
		<thead>
			<tr>
				<th>姓名</th>
				<th>年龄</th>
				<th>性别</th>
			</tr>
		</thead>
		<tbody id="ubody">
			<tr>
				<td>产品1</td>
				<td>23/11/2013</td>
				<td>待发货</td>
			</tr>
			
		</tbody>
</table>
</div>  	

</body>

<script type="text/javascript">

$(document).ready(function(){
	  // 在这里写你的代码...
	$.getJSON("/servletdemo/GetAllUserServlet", function(data){
		console.log(data);
		 $("#ubody").empty();
       // alert("Data Loaded: " + data);
       for(var i=0;i<data.length;i++){
    	   $("#ubody").append("<tr><td>"+data[i].name+"</td>"+"<td>"+data[i].age+"</td>"+"<td>"+data[i].sex+"</td></tr>");
       }
		
	});
	  
	});

</script>


</html>